package org.itcast.travel.mapper;

import java.util.List;

import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Mapper;
import org.itcast.travel.pojo.Blog;
import org.itcast.travel.pojo.BlogAndUser;
import org.itcast.travel.pojo.BlogQueryParam;

@Mapper
public interface BlogMapper {
    int delete(List<Integer> ids);

    int insert(Blog blog);

    List<Blog> selectAll();

    int update(Blog blog);

    Blog getById(Integer id);

    Page<BlogAndUser> page(BlogQueryParam blogQueryParam);

    Page<BlogAndUser> pageById(Integer userId, BlogQueryParam blogQueryParam);

    void addLike(Integer blogId);

    void subLike(Integer blogId);

    Page<BlogAndUser> pageLike(Integer userId, BlogQueryParam blogQueryParam);

    int count(BlogQueryParam blogQueryParam);

    void addCollect(Integer blogId);

    void subCollect(Integer blogId);

    Page<BlogAndUser> pageCollect(Integer userId, BlogQueryParam blogQueryParam);

    Page<BlogAndUser> pageLook(Integer userId, BlogQueryParam blogQueryParam);
}